/*
 * @Description: 作业门（道口）
 * @Author: Huang Junjie
 * @Date: 2021-09-23 15:09:55
 * @LastEditTime: 2021-09-28 12:42:17
 * @LastEditors: Huang Junjie
 */
import request from '@/utils/request'

// 查询列表信息
export function getListPage(query) {
  var params = JSON.parse(JSON.stringify(query))
  delete params.unitCodeParams
  return request({
    url: query.unitCodeParams ? ('/jcwBasic' + query.unitCodeParams + '/JcRoadJunction/') : '/jcwBasic/JcRoadJunction/',
    method: 'GET',
    params: params
  })
}

// 根据id查询信息
export function getInfoById(query) {
  var params = JSON.parse(JSON.stringify(query))
  delete params.unitCodeParams
  return request({
    url: query.unitCodeParams ? ('/jcwBasic' + query.unitCodeParams + `/JcRoadJunction/getById`) : `/jcwBasic/JcRoadJunction/getById`,
    method: 'GET',
    params: params
  })
}

// 新增/修改信息
export function addOrEditData(query) {
  var params = JSON.parse(JSON.stringify(query))
  delete params.unitCodeParams
  return request({
    url: query.unitCodeParams ? ('/jcwBasic' + query.unitCodeParams + '/JcRoadJunction/') : '/jcwBasic/JcRoadJunction/',
    method: 'POST',
    data: params
  })
}

// 删除信息
export function deleteData(query) {
  var params = JSON.parse(JSON.stringify(query))
  delete params.unitCodeParams
  return request({
    url: query.unitCodeParams ? ('/jcwBasic' + query.unitCodeParams + `/JcRoadJunction/${params.id}`) : `/jcwBasic/JcRoadJunction/${params.id}`,
    method: 'DELETE'
  })
}
